package com.rgh.pecunia.core;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import com.googlecode.objectify.Key;
import com.googlecode.objectify.Objectify;
import com.googlecode.objectify.Query;
import com.rgh.pecunia.domain.BusinessEntity;

public interface DataAccessObject extends Serializable {

    Objectify ofy();

     <O extends BusinessEntity> O get(Key<O> key);

     <O extends BusinessEntity> O find(Class<O> clazz, Long id);

     <O extends BusinessEntity> Query<O> query(Class<O> clazz);

     <O extends BusinessEntity> List<Key<O>> keys(Class<O> clazz);

     <O extends BusinessEntity> Query<O> query(Class<O> clazz, String criteria, Object value);

     <O extends BusinessEntity> List<Key<O>> keys(Class<O> clazz, String criteria, Object value);

     <O extends BusinessEntity> Query<O> query(Class<O> clazz, Map<String, Object> criterion);

     <O extends BusinessEntity> List<Key<O>> keys(Class<O> clazz, Map<String, Object> criterion);

     <O extends BusinessEntity> void put(O entity);

     <O extends BusinessEntity> void delete(O entity);
}
